import React, {FC, useEffect, useState} from "react";
import {Input} from "antd";

interface DefaultValueInputProps {
    value?: any
    ds?: any
}

const DefaultValueInput: FC<DefaultValueInputProps> = (props) => {

    const [value, setValue] = useState<any>();

    useEffect(() => {
        const {ds = {}}: { ds?: any } = props;
        let newValue: any = ds.value || props.value;
        setValue(newValue);
    }, [])

    return (<Input value={value} disabled={true}/>)
}

export default React.memo(DefaultValueInput);